﻿using System;
using System.Collections;
using System.Linq;
using System.Security.Cryptography.X509Certificates;

namespace ConsoleApp5
{
    class Program
    {
        static void Main(string[] args)
        {
            Stack stack = new Stack();
            //入栈
            stack.Push("东");
            stack.Push("南");
            stack.Push("西");
            stack.Push("北");
            
            //Peek
            //while (stack.Count != 0)
            //{
            //    Console.WriteLine(stack.Peek());
            //}
            //判断
            bool a = stack.Contains("寒");
            Console.WriteLine(a);
            //遍历
            while (stack.Count != 0)
            {
                Console.WriteLine(stack.Pop());
            }
            //清空
            stack.Clear();
        }
    }
}
